import java.util.Scanner;

public class Main {

    public String isWin;

    public static void main(String[] args) {
        Main main = new Main();
        System.out.println("开始游戏请按1");
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner input = new Scanner(System.in);
        int x = input.nextInt();
        while (x == 1) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            if (main.isWin.equals("true")){
                System.out.println("恭喜获胜！");
            }else if(main.isWin.equals("false")){
                System.out.println("很遗憾失败了！");
            }
            System.out.println("继续游戏请按1，结束游戏请按2");
            int y = input.nextInt();
            if (y == 2) {
                break;
            }
        }

    }

}
